package com.xuecheng.teaching.convert;

import com.xuecheng.api.teaching.model.dto.CourseWorkRecDTO;
import com.xuecheng.api.teaching.model.dto.WorkRecordDTO;
import com.xuecheng.teaching.entity.CourseWorkRec;
import com.xuecheng.teaching.entity.WorkRecord;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface CourseWorkRecConvert {
    CourseWorkRecConvert INSTANCE = Mappers.getMapper(CourseWorkRecConvert.class);

    @Mappings
    ({
            @Mapping(source = "id", target = "courseWorkId"),
            @Mapping(source = "answerNumber", target = "totalUsers")
    })
    CourseWorkRecDTO entity2dto(CourseWorkRec courseWorkRec);

    List<CourseWorkRecDTO> entitys2dtos(List<CourseWorkRec> entitys);


}
